]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Inhibit animations when there is a remote desktop session
authorJonas Ådahl <jadahl@gmail.com>
Tue, 1 Oct 2019 10:04:52 +0000 (12:04 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Thu, 20 Feb 2020 11:14:55 +0000 (11:14 +0000)
If a remote desktop session asks for animations to be disabled, inhibit
animations while the session is active.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/757

js/ui/main.js

index 65cbbd3ac8820e55bf0c74468af9858b81a8f9c4..05b30d5449e1c41d98183e713a45d1574a3ec074 100644 (file)
@@ -775,5 +775,31 @@ var AnimationsSettings = class {
             St.Settings.get().inhibit_animations();
             return;
         }
+
+        let remoteAccessController = backend.get_remote_access_controller();
+        if (!remoteAccessController)
+            return;
+
+        this._handles = new Set();
+        remoteAccessController.connect('new-handle',
+            (_, handle) => this._onNewRemoteAccessHandle(handle));
+    }
+
+    _onRemoteAccessHandleStopped(handle) {
+        let settings = St.Settings.get();
+
+        settings.uninhibit_animations();
+        this._handles.delete(handle);
+    }
+
+    _onNewRemoteAccessHandle(handle) {
+        if (!handle.get_disable_animations())
+            return;
+
+        let settings = St.Settings.get();
+
+        settings.inhibit_animations();
+        this._handles.add(handle);
+        handle.connect('stopped', this._onRemoteAccessHandleStopped.bind(this));
     }
 };